import React, { useState } from 'react';
import * as Doms from '../APreviewCom'

function PageItem({ page }) {
    let { width, height, components } = page ?? {};

    return (
        <div style={{ height, zoom: 112 / width }}>
            {
                components && components.map((item, i) => {
                    return React.createElement(Doms[item.type], { ...item, key: i });
                })
            }
        </div>
    );
}

export default PageItem;